package com.wanxi.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ResultDTO {
    private Integer code;   //放回编码：0正确，1错误
    private String msg;     //自定义数据
    private Integer count;  //影响条数
    private Object data;    //数据

    public static ResultDTO getDTO(int count, Object data) {
        ResultDTO resultDTO = ResultDTO.builder()
                .data(data)
                .count(count)
                .code(0)
                .build();
        return resultDTO;
    }

}
